package com.lmabbe.common.datasources.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface InitRoleResourceMapper {

    @Insert("<script>" +
            "INSERT ignore INTO sys_role_resource(role_resource_id,resource_id,role_id) VALUES" +
            "<foreach collection=\"resources\" item=\"resource\" index=\"index\"  separator=\",\">" +
            "(#{resource},1,#{resource})" +
            "</foreach>" +
            "</script>")
    void initRoleResource(List<String> resources);
}
